<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" isErrorPage="true" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@page import="com.opensymphony.xwork2.ognl.OgnlValueStack"%>
<%@page import="org.slf4j.Logger"%> 
<%@page import="org.slf4j.LoggerFactory"%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>权限管理系统-错误页面</title>
<%
	request.setAttribute("ctx", request.getContextPath());
%>
<link href="${ctx }/css/new_style.css" type="text/css" rel="stylesheet" />
<script src="${ctx }/js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="${ctx }/js/jquery.html5-placeholder-shim.js" type="text/javascript"></script>
<script src="${ctx }/js/jquery.cookie.js" type="text/javascript"></script>
<script type="text/javascript" src="${ctx }/js/jquery.pager.js"></script>

<style type="text/css">
		.clearfix:after {
			content: "\20";
			height: 0;
			visibility: hidden;
			display: block;
			clear: both;
			font-size: 0;
			line-height: 0;
		}
		.clearfix {
			zoom: 1;
		}
		.pub_err_pages {
			background-color: #f5f8fa;
		}
		.pub_err_pages .pub_err_con {
			width: 520px;
			padding-left: 310px;
			margin: 150px auto;
			font-size: 14px;
		}
		.pub_warnimg_pic {
			width: 238px;
			height: 210px;
			float: left;
			margin-left: -310px;
		}
		.pub_err_pages a {
			text-decoration: none;
		}
		.pub_err_pages a:hover {
			text-decoration: underline;
		}
		.pub_err_con h1 {
			width: 470px;
			height: 22px;
			line-height: 22px;
			font-size: 28px;
			overflow: hidden;
			text-indent: -999px;
		}
		.pub_err_con #h1 {
			width: 470px;
			height: 22px;
			line-height: 22px;
			font-size: 28px;
			overflow: hidden;
			text-indent: -999px;
		}
		.pub_err_con .pub_500 {
			background-position: 0 -22px;
		}
		.pub_err_operate {
			border-top: 1px dashed #c4c6c8;
			margin-top: 40px;
			padding-top: 40px;
		}
		.pub_err_operate strong {
			font-size: 14px;
		}
		.pub_err_operate a {
			color: #005de8;
		}
		.pub_err_pages .pub_footer {
			padding-bottom: 10px;
			font-size: 12px;
			text-align: center;
		}
		.pub_err_pages .footer_nav {
			width: 960px;
			margin: 0 auto;
			border-top: 1px solid #d1d5d8;
			padding: 25px 0 10px;
		}
		.pub_err_pages .footer_nav, .pub_err_pages .footer_nav a {
			color: #666666;
		}
		.pub_err_pages .footer_nav a {
			margin: 0 5px;
		}
		.pub_err_pages .copyright, .pub_err_pages .copyright a {
			color: #757575;
			font-family: tahoma;
		}
		#showExceptionDiv{
			cursor: pointer;
		}
		
	</style>
</head>

	 <%  
	 String isexinfo =  request.getParameter("isShowExceptionInfo");
	 boolean b = false;
	 try{
		 b = Boolean.parseBoolean(isexinfo);
	 }catch(Exception e){
	 }
	  ((OgnlValueStack) request.getAttribute("struts.valueStack")).set(  
	    "isShowExceptionInfo",b );  
	 %> 
<script  type="text/javascript">
$(document).ready(function(){
	$("#showExceptionDiv").click(function(){
		var exceptionDiv = $(".exceptionDiv");
		var display = exceptionDiv.css("display");
		if(display == 'none'){
			$(this).text("关闭异常信息");
			exceptionDiv.css("display","block");
		}else{
			$(this).text("展开异常信息");
			exceptionDiv.css("display","none");
		}
	});
	
});
</script>
<body class="pub_err_pages">
<div class="pub_err_con">
	<img src="${ctx }/images/err_warn.png" class="pub_warnimg_pic" alt="500提示"/>
	<h2 id="#h1" class="pub_500">
		<span>Error 500</span>
		很抱歉，您要访问的页面出现内部错误  </h2>
	<p>有可能我们的页面正在升级或者维护
	<s:if test="isShowExceptionInfo">
		<br/>
		<a href="#"><span id="showExceptionDiv">展开异常信息</span></a>
			<div class="exceptionDiv" style="display: none;">
				<%
					 	Logger logger = LoggerFactory.getLogger("error500");
						Exception ex = (Exception)request.getAttribute("Exception");
						logger.error(ex.getMessage(),ex);
				%>
				<%=ex.getMessage() %>
				<c:forEach var="trace" items="${exception.stackTrace}">
					<p>${trace}</p>
				</c:forEach>
			</div>
	</s:if>
	</p>
	<div class="pub_err_operate">
		<strong>您可以尝试以下操作：</strong>
		<p><a href="javascript:history.go(-1)" target="_self">  &nbsp;&nbsp;&nbsp;&lt;&lt;返回上一页</a></p>
		<p><a href="${ctx}/admin/index.do" target="_parent">&nbsp;&nbsp;&nbsp;&lt;&lt;返回首页</a></p>
	</div>
</div>
</body></html>